home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 46 / Amiga Format CD46 (1999-10-20)(Future Publishing)(GB)[!][issue 1999-12].iso / -in_the_mag- / reader_requests / scilab / demos / bike / macros / velo4.sci < prev    next >
Text File  |  1999-09-16  |  895b  |  30 lines

  1. //[]=velo4()
  2. // version with full wheels with  xgeom & xfpoly
  3. // ( geom performs the geometric calculations)
  4. t= t*180/%pi;
  5. p= p*180/%pi;
  6. xe=[xmin,xmax,xmax,xmin,xmin]
  7. ye=[ymin,ymin,ymax,ymax,ymin]
  8. param3d(xe,ye,zmin*ones(1,5),t,p," ",[1,0],rect);
  9. xset("alufunction",6)
  10. [xnt,ynt]=geom3d(xf,yf,zf);
  11. [xnf,ynf]=geom3d(xfrontar,yfrontar,zfrontar);
  12. [xnr,ynr]=geom3d(xrearar,yrearar,zrearar);
  13. /////////////////////////////////////
  14. [n1,n2]=size(xfrontar);
  15. deff('[]=velod(i)',['xpoly(xnt(:,i),ynt(:,i),''lines'')';
  16.       'xfpoly(xnr(:,i),ynr(:,i))';
  17.       'xfpoly(xnf(:,i),ynf(:,i))']);
  18.  
  19. deff('[]=traj(i)',['j=i-1;';
  20.    'param3d(xprear(1,j:i),xprear(2,j:i),xprear(3,j:i),t,p,'" "',[0,0])';
  21.    'param3d(xpfront(1,j:i),xpfront(2,j:i),xpfront(3,j:i),t,p,'" "',[0,0])']);
  22.  
  23. comp(velod);comp(traj);
  24. // Attention demarrer a i=2
  25. for i=2:1:n2,traj();velod(i);velod(i);end
  26. velod(n2);
  27. xset("alufunction",3);
  28. //end
  29.  
  30.